package com.th.therp.pojo.emtity;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Material {
    private Integer id;

    @NotBlank(message = "请输入名称")
    @Length(message = "名称的长度必须在 {min} 到 {max} 个字符之间", min = 1, max = 20)
    private String barcode;

    private Integer vendor;

    @NotBlank(message = "请输入名称")
    @Length(message = "名称的长度必须在 {min} 到 {max} 个字符之间", min = 1, max = 20)
    private String name;

    private String specification;
    private String unit;
    private Integer category;
    private Integer brand;

    @Positive(message = "采购价必须大于0")
    private double purchasePrice;

    @Positive(message = "销售价必须大于0")
    private double sellingPrice;

    private Integer status;
    private Integer isDeleted;
}
